package com.aipp.mall.h5.domain.entity;

import com.aipp.mall.common.anno.Note;
import com.aipp.mall.common.model.BaseAudit;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单中所包含的商品对象 oms_order_item
 *
 * @author zcc
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("oms_order_item")
public class OrderItem extends BaseAudit implements Serializable {

    @Serial
    private static final long serialVersionUID = -4791115114495003553L;

    @Note("ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Note("订单id")
    private Long orderId;

    @Note("PRODUCT_ID")
    private Long productId;

    @Note("商品编码")
    private String outProductId;

    @Note("商品sku id")
    private Long skuId;

    @Note("sku编码")
    private String outSkuId;

    @Note("商品快照id")
    private Long productSnapshotId;

    @Note("sku快照id")
    private Long skuSnapshotId;

    @Note("展示图片")
    private String pic;

    @Note("PRODUCT_NAME")
    private String productName;

    @Note("销售价格")
    private BigDecimal salePrice;

    @Note("采购价")
    private BigDecimal purchasePrice;

    @Note("购买数量")
    private Integer quantity;

    @Note("商品分类id")
    private Long productCategoryId;

    @Note("商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}]")
    private String spData;

}
